﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Qualify.aspx.cs" Inherits="ZhaoPin.Admin.Qualify" %>
    <%@ Import Namespace="ZhaoPin" %>
    <%@ Import Namespace="System.Data.Objects.DataClasses" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .para{ padding-top:10px;padding-bottom:10px; text-align:center;}
</style>
    <script type="text/javascript">
        var GB_ROOT_DIR = '<%=ResolveUrl("~/Scripts/greybox/")%>';
        function GetAllCheckBox(CheckAll) {
            //var items=document.getElementsByTagName("input");  
            var items = document.getElementsByName("CheckBoxGroup");
            for (var i = 0; i < items.length; i++) {
                if (items[i].type == "checkbox") {
                    //全选的CheckBox.checked为true则为为全选,false则反选  
                    items[i].checked = CheckAll.checked;
                }
            }
        }

        //检查是否至少选择了一项   
        function CheckHasSelectedItem() {
            //得到所有name为CheckBoxGroup   
            var checkbox = document.all.CheckBoxGroup;

            if (checkbox == null) {
                return false;
            }

            if (checkbox.length + "" != "undefined") {
                for (var i = 0; i < checkbox.length; i++) {
                    if (checkbox[i].checked) {
                        return true;
                    }
                }
            }
            /*当数据库中只有一条记录时,  
            * document.all.CheckBoxGroup取出的是Object对象而不是数组  
            所以我们在这还要判断得到Object对象时是否被选中  
            (可以在数据库中只去一条数据测试(top 1),查看是否有这个小Bug)  
            */
            else if (checkbox.checked) {
                return true;
            }
            else {
                return false;
            }
        }

        function CheckSelection() {
            if (CheckHasSelectedItem())//如果至少选择了一项   
            {
                return true;
            }
            else {
                alert("请至少选择一项！");
                return false;
            }
        }
        function ShowDetails(personId) {
            return GB_showCenter('详细报名信息', '/ZhaoPin/Admin/ShowDetails.aspx?Id='+personId, 550, 780, GB_showCallback)
        }
        function GB_showCallback() {
            
        }   
    </script>
    <script type="text/javascript" src="../Scripts/greybox/AJS.js"></script>
    <script type="text/javascript" src="../Scripts/greybox/AJS_fx.js"></script>
    <script type="text/javascript" src="../Scripts/greybox/gb_scripts.js" charset="gb2312"></script>
    <link href="../Scripts/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div align="center">
        快速查询：<asp:TextBox ID="tbSearch" runat="server"></asp:TextBox>
        <asp:DropDownList ID="ddSearchType" runat="server">
            <asp:ListItem Selected="True" Value="0">报名序号</asp:ListItem>
            <asp:ListItem Value="1">身份证号</asp:ListItem>
            <asp:ListItem Value="2">姓名</asp:ListItem>
            <asp:ListItem Value="3">报考岗位</asp:ListItem>
        </asp:DropDownList>
        <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" />
        <asp:CheckBox ID="cbChecked" runat="server" />已审核已通过
        <asp:CheckBox ID="cbCheckedBad" runat="server" />已审核未通过
        <asp:CheckBox ID="cbArranged" runat="server" />已分考场
        <asp:CheckBox ID="cbScored" runat="server" />已出成绩
    </div>
    <div class="para">
        <asp:GridView ID="gvList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            DataKeyNames="Id" EmptyDataText="没有数据可以显示" PageSize="15" 
            onrowdatabound="gvList_RowDataBound">
            <PagerSettings PageButtonCount="5" />
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        全选<input type="checkbox" onclick="javascript:GetAllCheckBox(this);" name="selectAll" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input type="checkbox" name="CheckBoxGroup" value='<%#Eval("Id") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Sequence" HeaderText="报名序号" SortExpression="Sequence" />
                <asp:BoundField DataField="RealName" HeaderText="姓名" SortExpression="RealName" />
                <asp:BoundField DataField="IdentityCardNumber" HeaderText="身份证号码" />
                <asp:TemplateField HeaderText="政治面貌">
                    <ItemTemplate>
                        <asp:Label ID="lbNation" runat="server" Text='<%# Eval("TDictNation.FName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="FirstJobDate" HeaderText="参加工作时间" DataFormatString="{0:Y}"
                    SortExpression="FirstJobDate" />
                <asp:TemplateField HeaderText="第一学历">
                    <ItemTemplate>
                        <asp:Label ID="lbEduLevel" runat="server" Text='<%# GetFirstEduLevel((EntityCollection<EduStory>)Eval("EduStories")) %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div class="para">
    <div>退回及未通过原因</div>
    <div><asp:TextBox ID="tbReason" runat="server" Width="600px" 
            EnableViewState="False"></asp:TextBox></div>
    </div>
    <div class="para">
    <asp:Button ID="btnCheckOk" runat="server" Text="审核通过" OnClick="btnCheckOk_Click"
        OnClientClick="return CheckSelection()" />
    <asp:Button ID="btnCheck2Uncheck" runat="server" Text="撤销审核" 
            OnClientClick="return CheckSelection()" onclick="btnCheck2Uncheck_Click" />
    <asp:Button ID="btnCheckBadReturnRefill" runat="server" Text="退回修改" 
            OnClientClick="return CheckSelection()" 
            onclick="btnCheckBadReturnRefill_Click" />
    <asp:Button ID="btnCheckBadNotRefill" runat="server" Text="审核未通过" 
            OnClientClick="return CheckSelection()" onclick="btnCheckBadNotRefill_Click" />
    </div>
</asp:Content>
